// export const baseURL = 'http://192.168.1.36:8080';
export const baseURL= 'https://api.tongzhijiuye.cn/prod-api';
// export const baseURL: string = 'http://192.168.4.105:9090';

export const imgURL = 'https://api.tongzhijiuye.cn/prod-api';
// export const imgURL: string = 'http://192.168.4.107:9090';
export const formatDate = (cellValue) => {
  if (cellValue == null || cellValue == '') return '';
  const date = new Date(cellValue);
  const year = date.getFullYear();
  const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
  const day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
  const hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
  const minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
  const seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
  return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
};
export function setInputValue(e) {
  const obj = {
      value: e.detail.value,
      dataset: e.target.dataset,
  }
  return obj
}


export function setdateObj(e) {
  const obj = e.currentTarget.dataset
  return obj
}
export function setToken(mykey, con) {
  wx.setStorage({
      key: mykey,
      data: con
  })
}
export function getToken(mykey) {
  return wx.getStorageSync(mykey)
}

export function loading(str) {
  wx.showLoading({
      title: str,
  })
}
export function back(str = 1) {
  wx.navigateBack({
      delta: str,
  })
}
export function showToast(msg) {
  wx.showToast({
      title: msg,
      icon: 'none',
      duration: 2500
  })
}